The particle iterator allows you to browse particles of a specific particle group's subgroup type.
It natively supports multiple processors so you don't have to worry about it yourself.
FXParticle* GetParticle (void);
Returns
The current particle.
Parameters
const int cpu:
the current cpu thread.
FXParticle* GetFirstParticle (void);
Returns
The first particle for the given cpu.
Parameters
const int cpu:
the current cpu thread.
FXParticle* GetLastParticle (void);
Returns
The last particle for the given cpu.
Parameters
const int cpu:
the current cpu thread.
bool Init (FXParticleGroup* group, const ParticleFactoryTypes m_factory);
Returns
true if the iterator was initialised successfully.
Parameters
FXParticleGroup* group:
Pass the particle group containing the particles to iterate.
const ParticleFactoryTypes m_factory:
The particle subgroup type.
const int cpus:
Pass the amount of cpu threads you will be using for iterating particles.
void Restart (void);
This will reset the iterator for the given cpu.
Parameters
const int cpu:
the cpu thread to reset the iterator for.
bool SetNext (void);
Steps the iterator to get the next iterator. Use for forward stepping.
Returns
true if the iterator has been incremented.
Parameters
const int cpu:
the current cpu thread to increment the iterator for.
bool SetPrev (void);
Steps the iterator to get the previous iterator. Use for backward stepping.
Returns
true if the iterator has been decremented.
Parameters
const int cpu:
the current cpu thread to decrement the iterator for.
void Offset (long offset);
Offsets the iterator to a user defined position. This is currently private.
Parameters
const long offset:
the iterator offset.
const int cpu:
the current cpu thread to offset the iterator for.
bool OffsetSafe (long offset);
Offsets the iterator to a user defined position.
Returns
true if the offset operation was successful and the resulting iterator is valid.
Parameters
const long offset:
the iterator offset.
const int cpu:
the current cpu thread to offset the iterator for.
bool IsValid (void) const;
Returns
true if the current iterator is valid.
static FXParticleIterator* Alloc (void);
Allocates the iterator. You can use AutoAlloc for a scope based allocation.
Returns
the FXParticleIterator. The user owns the pointed object.
static void Free (FXParticleIterator*& p);
Frees a previously allocated FXParticleIterator.
Parameters
FXParticleIterator*&:
Pass the FXParticleIterator to free.